/* function TreeNode(x) {
    this.val = x;
    this.left = null;
    this.right = null;
} */
function FindPath(root, expectNumber)
{
    if(root === null) return []
    let res = []
    let path = []
    function findPath(pRoot,target){
      if(pRoot === null) return 
      path.push(pRoot.val)
      target -= pRoot.val
      if(target === 0 && pRoot.left === null && pRoot.right === null){
        var arr = [].concat(path)
        res.push(arr)
      }
      findPath(pRoot.left,target)
      findPath(pRoot.right,target)
      path.pop()
    }
    findPath(root,expectNumber)
    return res
}
module.exports = {
    FindPath : FindPath
};